package xyz.labradormm.auth.config;


import xyz.labradormm.auth.enums.StatusCode;

/**
 * 自定义系统异常
 */
public class ApplicationException extends RuntimeException {

    private static final long serialVersionUID = -7883840067913852752L;

    private final int code;

    public ApplicationException(int code, String message) {
        super(message);
        this.code = code;
    }

    public ApplicationException(StatusCode statusCode) {
        super(statusCode.getMsg());
        this.code = statusCode.getCode();
    }

    public ApplicationException(StatusCode statusCode, String message) {
        super(message);
        this.code = statusCode.getCode();
    }


    public int getCode() {
        return code;
    }
}
